package com.cmsky.open.base.model;

import javax.validation.constraints.*;
import org.hibernate.validator.constraints.*;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

import java.util.*;

import com.cmsky.open.core.base.*;
import com.cmsky.open.core.util.*;

import cn.org.rapid_framework.util.*;
import cn.org.rapid_framework.web.util.*;
import cn.org.rapid_framework.page.*;
import cn.org.rapid_framework.page.impl.*;

import com.cmsky.open.base.model.*;
import com.cmsky.open.base.dao.*;
import com.cmsky.open.base.manager.*;
import com.cmsky.open.base.vo.query.*;

/**
 * @author jandyfish email:jandyfish(a)gmail.com
 * @version 1.0
 * @since 1.0
 */


public class GoodsClassifyInfo extends BaseEntity implements java.io.Serializable{
	private static final long serialVersionUID = 5454155825314635342L;
	
	//alias
	public static final String TABLE_ALIAS = "GoodsClassifyInfo";
	public static final String ALIAS_ID = "编号";
	public static final String ALIAS_NAME = "分类名";
	public static final String ALIAS_PID = "父分类";
	public static final String ALIAS_TYPE = "商品类型";
	
	//date formats
	
	//可以直接使用: @Length(max=50,message="用户名长度不能大于50")显示错误消息
	//columns START
    /**
     * 编号       db_column: id 
     */	
	
	private java.lang.Integer id;
    /**
     * 分类名       db_column: name 
     */	
	@NotBlank @Length(max=20)
	private java.lang.String name;
    /**
     * 父分类       db_column: pid 
     */	
	@NotNull 
	private java.lang.Integer pid;
    /**
     * 商品类型       db_column: type 
     */	
	@NotNull @Max(127)
	private Integer type;
	//columns END

	public GoodsClassifyInfo(){
	}

	public GoodsClassifyInfo(
		java.lang.Integer id
	){
		this.id = id;
	}

	public void setId(java.lang.Integer value) {
		this.id = value;
	}
	
	public java.lang.Integer getId() {
		return this.id;
	}
	public void setName(java.lang.String value) {
		this.name = value;
	}
	
	public java.lang.String getName() {
		return this.name;
	}
	public void setPid(java.lang.Integer value) {
		this.pid = value;
	}
	
	public java.lang.Integer getPid() {
		return this.pid;
	}
	public void setType(Integer value) {
		this.type = value;
	}
	
	public Integer getType() {
		return this.type;
	}
	
	private Set goodsClassifyInfos = new HashSet(0);
	public void setGoodsClassifyInfos(Set<GoodsClassifyInfo> goodsClassifyInfo){
		this.goodsClassifyInfos = goodsClassifyInfo;
	}
	
	public Set<GoodsClassifyInfo> getGoodsClassifyInfos() {
		return goodsClassifyInfos;
	}
	
	private GoodsClassifyInfo goodsClassifyInfo;
	
	public void setGoodsClassifyInfo(GoodsClassifyInfo goodsClassifyInfo){
		this.goodsClassifyInfo = goodsClassifyInfo;
	}
	
	public GoodsClassifyInfo getGoodsClassifyInfo() {
		return goodsClassifyInfo;
	}

	public String toString() {
		return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
			.append("Id",getId())
			.append("Name",getName())
			.append("Pid",getPid())
			.append("Type",getType())
			.toString();
	}
	
	public int hashCode() {
		return new HashCodeBuilder()
			.append(getId())
			.toHashCode();
	}
	
	public boolean equals(Object obj) {
		if(obj instanceof GoodsClassifyInfo == false) return false;
		if(this == obj) return true;
		GoodsClassifyInfo other = (GoodsClassifyInfo)obj;
		return new EqualsBuilder()
			.append(getId(),other.getId())
			.append(getName(),other.getName())
			.append(getPid(),other.getPid())
			.append(getType(),other.getType())
			.isEquals();
	}
}

